#ifndef SERIAL_RX_THREAD_H
#define SERIAL_RX_THREAD_H

#include <QObject>
#include <QMutex>
#include <QDebug>
#include <QThread>

#include "serial_port/serial_port.h"

class Serial_Rx_Thread : public QObject
{
    Q_OBJECT
public:
        Serial_Rx_Thread(Serial_Port* sp = nullptr);
        ~Serial_Rx_Thread();

        void stop_thread();
        void serial_port_data_process(char *p_data,unsigned int data_len);


signals:
        void signal_get_sys_config(unsigned char *p_data,unsigned char data_len);
        void signal_set_sys_config(unsigned char *p_data,unsigned char data_len);
        void signal_get_dev_info(unsigned char *p_data,unsigned char data_len);
        void signal_slave_notify(unsigned char *p_data,unsigned char data_len);

public slots:
        void slot_serial_port_rx_thread();

private:

        bool stop_flag;
        QMutex stop_mutex;
        Serial_Port *serial_port;
};





#endif
